﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DTO;
using BUS;
namespace GUI
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            this.lblTenNV.Text = SS.taikhoan.TEN;
            this.lblMNV.Text = SS.taikhoan.MANV;
            String loai = SS.taikhoan.LOAINV.Trim();

            //MessageBox.Show();
            if (loai.Equals("1"))
            {
                this.quảnLýToolStripMenuItem.Enabled = false;
                lblLoaiNV.Text = "Tài xế";
            }
            else if (loai.Equals("2"))
            {
                lblLoaiNV.Text = "Quản lý";
                this.quảnLýToolStripMenuItem.Enabled = true;
            }
            else
            {
                this.quảnLýToolStripMenuItem.Enabled = false;
                lblLoaiNV.Text = "Lơ xe";
            }
        }

        private void lịchĐiToolStripMenuItem_Click(object sender, EventArgs e)
        {
           
        }

        private void đăngKýLịchVậnChuyểnToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormDKLichVanChuyen frm = new FormDKLichVanChuyen();
            frm.ShowDialog();
        }

        
        private void đặtChổToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormDatCho frm = new FormDatCho();
            frm.ShowDialog();
        }

        

        private void đăngNhậpToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
            Application.Restart();
            //FormDangNhap frm = new FormDangNhap();
            //frm.Show();
        }

        private void xemToolStripMenuItem_Click(object sender, EventArgs e)
        {
            thayDoiHoaDonHang frm = new thayDoiHoaDonHang();
            frm.ShowDialog();
            
        }

        private void thoátToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void kếtNốiCSDLToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormCSDL frm = new FormCSDL();
            frm.ShowDialog();
        }

        private void đăngKýToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormDanhSachDangKy frm = new FormDanhSachDangKy();
            frm.ShowDialog();
        }

        private void chuyếnXeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormThemXoaSuaChuyenXe frm = new FormThemXoaSuaChuyenXe();
            frm.ShowDialog();
        }

        private void traCứuChuyếnXeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormTraCuuThongTinChuyenXe frm = new FormTraCuuThongTinChuyenXe();
            frm.ShowDialog();
        }

        private void báoCáoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormDanhSachLichDi frm = new FormDanhSachLichDi();
            frm.ShowDialog();
        }

        private void thêmXóaSửaLịchToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormThemXoaSuaLichDi frm = new FormThemXoaSuaLichDi();
            frm.ShowDialog();
        }

        private void xeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormThemXoaSuaXe frm = new FormThemXoaSuaXe();
            frm.ShowDialog();
        }

        private void loạiXeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormDanhSachLoaiXe frm = new FormDanhSachLoaiXe();
            frm.ShowDialog();
        }

        private void đặtChổToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            FormDatCho frm = new FormDatCho();
            frm.ShowDialog();
        }

       
        
    }
}
